package com.nut.spp.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 层级 0客户 1非会员代理 2会员代理 3合伙人 4代理公司 5总公司合伙人
 */
public enum MemberLevelEnum {

    Member(0, "0客户"),
    NoMemberProxy(1, "1非会员代理"),
    MemberProxy(2, "2会员代理"),
    Partner(3, "3合伙人"),
    ProxyCompany(4, "4代理公司"),
    TopPartner(5, "5总公司合伙人"),
    ;

    private Integer value;

    private String desc;

    MemberLevelEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static Map<Integer, MemberLevelEnum> map = new HashMap<>();

    static {
        for (MemberLevelEnum stepEnum : MemberLevelEnum.values()) {
            map.put(stepEnum.value, stepEnum);
        }
    }

    public static MemberLevelEnum valueOf(int value) {
        return map.get(value);
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
